//
//  BankBillRootViewController.swift
//  KaMengApplication
//
//  Created by DUONIU_MAC on 2018/11/7.
//  Copyright © 2018年 DUONIU_MAC. All rights reserved.
//

import UIKit
import XLPagerTabStrip

class BankBillRootViewController: KMPageViewController {
    
    init(title:String) {
        super.init(nibName: nil, bundle: nil)
        
        self.title = import_title + title
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func viewDidLoad() {
        topBarStyle()
        super.viewDidLoad()

        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }
    
    //AMRK: 顶部滚动条样式
    fileprivate func topBarStyle() {
        
        settings.style.buttonBarBackgroundColor = UIColor.mineColor()
        settings.style.buttonBarItemTitleColor = UIColor.black
        settings.style.buttonBarItemBackgroundColor = UIColor.clear
        settings.style.selectedBarBackgroundColor = UIColor.red
        settings.style.buttonBarItemFont = UIFont.systemFont(ofSize: RATIO(maxNum: 16))
        settings.style.selectedBarHeight = 3
        settings.style.buttonBarHeight = RATIO_H(maxNum: 50)
        
        //修改选中字体颜色
        changeCurrentIndexProgressive = {(oldCell,newCell,progressPercentage,changeCurrentIndex,animated) in
            
            oldCell?.label.textColor = UIColor.black
            newCell?.label.textColor = UIColor.red
        }
    }
    
    //MARK: 滑动的子控制
    override func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController] {
        
        let titleArray = [cardNumber,phoneNumber,userName]
        let placeholderArray = [cardTypeNumber,phoneNumber,userName]
        
        var viewControllers = [UIViewController]()
        
        for i in 0..<titleArray.count {
            let bankBillVC = BankBillViewController.init(placeholder: placeholderArray[i])
            bankBillVC.itemInfo.title = titleArray[i]
            viewControllers.append(bankBillVC)
        }
        
        return viewControllers
    }


}
